import request from '@/plugin/axios'

export function fetchList (data) {
  return request({
    url: '/reserve/queryAllScheduleList',
    method: 'get',
    params: {
      queryCondition: data
    }
  })
}

export function createOrEdit (data) {
  return request({
    url: '/reserve/createOrEditSchedule',
    method: 'post',
    data: data
  })
}

export function queryById (id) {
  return request({
    url: '/classroom/queryById?id=' + id,
    method: 'get'
  })
}

export function deleteById(id) {
  return request({
    url: '/reserve/deleteSchedule?id=' + id,
    method: 'get'
  })
}

export function baseDataList (data) {
  let _url = "";
  if(data == 1)
    _url = "/course/queryCourseList";
  if(data == 2)
    _url = "/classroom/queryClassRoomList";
  if(data == 3)
    _url = "/user/queryTeacherList";
  if(data == 4)
    _url = "/reserve/shopList";

  return request({
    url: _url,
    method: 'get'
  })
}